﻿package mortal.component.skin.combobox.comboboxSkin
{
    import com.mui.core.*;
    import com.mui.display.*;
    import flash.display.*;
    import mortal.component.gconst.*;
    import mortal.game.resource.*;

    public class ComboboxUpSkin extends Sprite
    {
        private var _bg:ScaleBitmap;
        private var _button:Bitmap;

        public function ComboboxUpSkin()
        {
            this.createChildren();
            return;
        }// end function

        private function createChildren() : void
        {
            this._bg = ResourceConst.getScaleBitmap(ImagesConst.ComboBg);
            addChild(this._bg);
            this._button = GlobalClass.getBitmap(ImagesConst.DownButton_upSkin);
            addChild(this._button);
            this._bg.height = this._button.height + 2;
            return;
        }// end function

        override public function set width(param1:Number) : void
        {
            this._bg.width = param1;
            this._button.x = this._bg.width - this._button.width - 2;
            return;
        }// end function

        override public function set height(param1:Number) : void
        {
            this._bg.height = param1;
            this._button.y = Math.max((this._bg.height - this._button.height) / 2, 0);
            return;
        }// end function

    }
}
